﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using StudentsManager.Models;

namespace StudentsManager.Forms
{
    public partial class SchoolForm : Form
    {
        public School QuerySchool { get; set; }

        public SchoolForm()
        {
            InitializeComponent();
        }

        public SchoolForm(School school)
        {
            InitializeComponent();
            txtSchoolName.Text = school.Name;
            txtSchoolAddress.Text = school.Address;
        }

        private void btnQuery_Click(object sender, EventArgs e)
        {
            QuerySchool = new School
            {
                Name = txtSchoolName.Text.Trim(),
                Address = txtSchoolAddress.Text.Trim()
            };
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
